# 读取配置文件

import os
import configparser


def get_Path():
    path = os.path.split(os.path.realpath(__file__))[0]

    return path


path = get_Path()
config_path = os.path.join(path, 'config.ini')
config = configparser.ConfigParser()  # 调用外部的读取配置文件的方法

config.read(config_path, encoding='utf-8')


class ReadConfig():

    def get_PWD(self, name):
        value = config.get('PWD', name)

        return value

    def get_LIST(self, name):
        value = config.get('LIST', name)

        return value
    # def get_email(self, name):
    #     value = config.get('EMAIL', name)
    #
    #     return value
    #
    # def get_mysql(self, name):  # 写好，留以后备用。但是因为我们没有对数据库的操作，所以这个可以屏蔽掉
    #
    #     value = config.get('DATABASE', name)
    #
    #     return value


# if __name__ == '__main__':
#     print(path)
#     print(config_path)
#     print(ReadConfig().get_PWD('username'))
#     print(ReadConfig().get_PWD('password'))
#     print(ReadConfig().get_PWD('tenant_id'))

